import React, { useEffect, useState } from 'react'
import Student from './components/student'

function App() {

    const [student, setStudent] = useState([]);

    const getStudentData = async () => {
        try {
            const response = await fetch("http://localhost:1337/api/students");
            const result = await response.json();
            setStudent(result.data);
        } catch (error) { }
    };

    useEffect(() => {
        getStudentData();
    }, []);


    return <div>
        <Student studentData={student} />
    </div>
}

export default App